
<?
/**
* @version : shoutbox.class.php,v 1.8 2004/09/27 15:18:21 stingrey Exp $
* @package Mambo_4.5.1
* @copyright (C) 2000 - 2004 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/**
* congregationMember database table class
* @package Mambo_4.5.1
*/
class congregationMember extends mosDBTable {

	var $c_id = null;
//	c_id varchar(20) NOT NULL default '',
	var $username = null;
//	username varchar(255) NOT NULL default '',
	var $rid = null;
//	rid varchar(20) NOT NULL default '',
	var $lname = null;
	//lname varchar(255) NOT NULL default '',
	var $fname = null;
	//fname varchar(255) NOT NULL default '',
	var $bdate = null;
	//bdate date NOT NULL default '0000-00-00',
	var $bplace = null;
	//bplace varchar(255) NOT NULL default '',
	var $edate = null;
	//edate date NOT NULL default '0000-00-00',
	var $eplace = null;
	//eplace varchar(255) NOT NULL default '',
	var $ndate = null;
	//ndate date NOT NULL default '0000-00-00',
	var $nplace = null;
	//nplace varchar(255) NOT NULL default '',
	var $vdate = null;
	//vdate date NOT NULL default '0000-00-00',
	var $vplace = null;
	//vplace varchar(255) NOT NULL default '',
	var $fdate = null;
	//fdate date NOT NULL default '0000-00-00',
	var $fplace = null;
	//fplace varchar(255) NOT NULL default '',
	var $odate = null;
	//odate date NOT NULL default '0000-00-00',
	var $oplace = null;
	//oplace varchar(255) NOT NULL default '',
	var $ddate = null;
	//ddate date NOT NULL default '0000-00-00',
	var $dplace = null;
	//dplace varchar(255) NOT NULL default '',
	var $altemail = null;
	//altemail varchar(255) NOT NULL default '',
	var $status = null;
	//status tinyint(1) NOT NULL default '1',
	var $address = null;
	//address text NOT NULL,
	var $cell = null;
	//cell varchar(20) NOT NULL default '',
	var $language = null;
	//language varchar(10) NOT NULL default '',
	var $nationality = null;
	//nationality varchar(255) NOT NULL default '',
	var $picfile = null;
	//picfile varchar(255) NOT NULL default '',
	var $skype = null;
	//skype varchar(255) NOT NULL default '',
	var $ordering = null;
	//skype varchar(255) NOT NULL default '',
	
	function congregationMember( &$db ) {
		$this->mosDBTable( '#__congregation_profile', 'username', $db );
	}

	/** overloaded check function */
	function check() {
		
		/** check for valid name */
		if (trim( $this->c_id ) == '') {
			$this->_error = _Profile_Casa_Required;
			return false;
		}

		Return true;

	}

	function store( $updateNulls=false ) {
		$k = $this->_tbl_key;
		if ($this->$k) {
			$ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key, $updateNulls );
		} else {
			$ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );
		}
		if( !$ret ) {
			$this->_error = strtolower(get_class( $this ))."::store failed <br />" . $this->_db->getErrorMsg();
			return false;
		} else {
			return true;
		}
	}

}

class congregationCasa extends mosDBTable {
	var $c_id = null;
	var $p_id = null;
	var $c_name = null;
	var $c_address = null;
	var $c_zip = null;
	var $c_city = null;
	var $c_state = null;
	var $c_country = null;
	var $c_tel = null;
	var $c_fax = null;
	var $c_email = null;
	var $c_web = null;
	var $c_found = null;
	var $c_diocese = null;
	var $c_picfile = null;
	var $lastupdate = null;
	var $submitter = null;
	var $ordering = null;
	var $hit = null;

	function congregationCasa( &$db ) {
		$this->mosDBTable( '#__congregation_casa', 'c_id', $db );
	}

	function check() {
		
		/** check for valid province */
		if (trim( $this->p_id ) == '') {
			$this->_error = _Casa_Province_Required;
			return false;
		}
		if (trim( $this->c_name ) == '') {
			$this->_error = _Casa_Name_Required;
			return false;
		}

		Return true;

	}

}

class congregationProvince extends mosDBTable {

	var $p_id = null;
	var $p_name = null;
	var $ordering = null;
	function congregationProvince( &$db ) {
		$this->mosDBTable( '#__congregation_province', 'p_id', $db );
	}

	function check() {
		
		/** check for valid province */
		if (trim( $this->p_name ) == '') {
			$this->_error = _Province_Name_Required;
			return false;
		}
		Return true;
	}

}

class congregationStatus extends mosDBTable {

	var $id   = null;
	var $abbr = null;
	var $text = null;
	var $ordering = null;
	function congregationStatus( &$db ) {
		$this->mosDBTable( '#__congregation_status', 'id', $db );
	}

}

?>
